home *** CD-ROM | disk | FTP | other *** search
-
-
-
- ppppmmmmiiiinnnnffffoooo((((3333)))) ppppmmmmiiiinnnnffffoooo((((3333))))
-
-
-
- NNNNAAAAMMMMEEEE
- __pm_get_page_info, __mld_to_node - retrieve placement information
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ppppmmmmoooo....hhhh>>>>
-
- ttttyyyyppppeeeeddddeeeeffff ssssttttrrrruuuucccctttt ppppmmmm____ppppggggiiiinnnnffffoooo____ssss {{{{
- ccccaaaaddddddddrrrr____tttt vvvvaaaaddddddddrrrr;;;;
- ddddeeeevvvv____tttt nnnnooooddddeeee____ddddeeeevvvv;;;;
- uuuuiiiinnnntttt ppppaaaaggggeeee____ssssiiiizzzzeeee;;;;
- ppppmmmmoooo____hhhhaaaannnnddddlllleeee____tttt ppppmmmm____hhhhaaaannnnddddlllleeee;;;;
- vvvvooooiiiidddd**** rrrreeeesssseeeerrrrvvvveeeedddd[[[[2222]]]];;;;
- }}}} ppppmmmm____ppppggggiiiinnnnffffoooo____tttt;;;;
-
- iiiinnnntttt ________ppppmmmm____ggggeeeetttt____ppppaaaaggggeeee____iiiinnnnffffoooo((((vvvvooooiiiidddd ****bbbbaaaasssseeee____aaaaddddddddrrrr,,,,
- ssssiiiizzzzeeee____tttt lllleeeennnnggggtttthhhh,,,,
- ppppmmmm____ppppggggiiiinnnnffffoooo____tttt**** ppppggggiiiinnnnffffoooo____bbbbuuuuffff,,,,
- iiiinnnntttt bbbbuuuuffff____lllleeeennnn))))
-
- ddddeeeevvvv____tttt ________mmmmlllldddd____ttttoooo____nnnnooooddddeeee((((ppppmmmmoooo____hhhhaaaannnnddddlllleeee____tttt mmmmlllldddd____hhhhaaaannnnddddlllleeee))))
-
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The above two interfaces can be used to get placement information of a
- process's address space. It has to be done from the context of that
- process.
-
- ___________pppp_mmmm______gggg_eeee_tttt______pppp_aaaa_gggg_eeee______iiii_nnnn_ffff_oooo takes an address range in terms of base_addr and
- length. pginfo_buf is an array of pm_pginfo_t structures passed by the
- caller. On completion of the system call pginfo_buf contains the
- placement information for every page in the address range that has been
- faulted in. The vaddr field of pm_pginfo_t contains the virtual address
- of the page, node_dev contains the hardware graph dev_t of the node where
- the page has been placed. page_size is the page size used while mapping
- that virtual address. pm_handle is the handle of the pm that is attached
- to that virtual address. From dev_t one can get the hardware graph device
- name by using the libc routine dev_to_devname. If a page in the virtual
- address range has not been faulted in there is no corresponding entry in
- the pginfo_buf. If there is no error the return value contains the number
- of entries in the buffer that have been filled by the kernel.
-
- ___________mmmm_llll_dddd______tttt_oooo______nnnn_oooo_dddd_eeee converts an mld to the node where the mld has been placed.
- It returns the hardware graph dev_t of the node. The hardware graph name
- can be found by using the library routine dev_to_devname(2).
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- numa(5), mmci(5), mld(3c), mldset(3c), pm(3c), migration(3c),
- dev_to_devname(2)
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- ppppmmmmiiiinnnnffffoooo((((3333)))) ppppmmmmiiiinnnnffffoooo((((3333))))
-
-
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- Returns -1 on error.
-
- ___________pppp_mmmm______gggg_eeee_tttt______pppp_aaaa_gggg_eeee______iiii_nnnn_ffff_oooo will fail and the pm_pginfo_t structure will not be
- filled in if one or more of the following are true:
-
- _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT Arguments could not be copied into or out of kernel space.
-
- _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT pginfo_buf address does not exist in the address space.
-
- _EEEE_IIII_NNNN_VVVV_AAAA_LLLL If the number of elements in the pginfo is < 1.
-
- _EEEE_IIII_NNNN_VVVV_AAAA_LLLL If the _bbbb_aaaa_ssss_eeee______aaaa_dddd_dddd_rrrr plus the _llll_eeee_nnnn_gggg_tttt_hhhh results in an overflow
- condition that produces an ending address that is less
- that the _bbbb_aaaa_ssss_eeee______aaaa_dddd_dddd_rrrr.
-
- _EEEE_2222_BBBB_IIII_GGGG If the number of elements > 1024.
-
- ___________mmmm_llll_dddd______tttt_oooo______nnnn_oooo_dddd_eeee will fail and return an error if one or more of the
- following is true:
-
- _EEEE_IIII_NNNN_VVVV_AAAA_LLLL The MLD handle does not exist or is invalid.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEE
- #include <sys/types.h>
- #include <sys/pmo.h>
- #include <sys/attributes.h>
- #include <sys/conf.h>
- #include <sys/hwgraph.h>
- #include <sys/stat.h>
- #include <invent.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-
- #define NUMNODES 100
- #define NBPP 16384
- #define STACK_SIZE 20*NBPP
- #define DATA_SIZE 20*NBPP
-
- char databuf[DATA_SIZE];
-
- pm_pginfo_t node_buf[NUMNODES];
-
- void print_nodes(pm_pginfo_t *, int);
- extern int __pm_get_page_info();
-
- void
- main(int argc, char **argv)
- {
- char stkbuf[STACK_SIZE];
- int ret;
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- ppppmmmmiiiinnnnffffoooo((((3333)))) ppppmmmmiiiinnnnffffoooo((((3333))))
-
-
-
- volatile char *addr;
-
-
- printf("addr %x len %x0,databuf, stkbuf - databuf + STACK_SIZE);
- addr = databuf;
- while (addr < (databuf + DATA_SIZE)) {
- *addr = 0;
- addr += NBPP;
- }
-
- ret = __pm_get_page_info(0, 0x7fffffff, &node_buf, NUMNODES);
- printf("__pm_get_page_info returns ret %d0, ret);
- if (ret == -1) {
- perror("__pm_get_page_info");
- exit(1);
- }
-
- printf("stack buf nodes0);
- print_nodes(node_buf, ret);
-
- ret = __pm_get_page_info(databuf, sizeof(databuf), &node_buf, NUMNODES);
- printf("__pm_get_page_info returns ret %d0, ret);
- if (ret == -1) {
- perror("__pm_get_page_info");
- exit(1);
- }
- printf("data buf nodes0);
- print_nodes(node_buf, ret);
- }
-
- void
- print_nodes(pm_pginfo_t *nbuf, int numnodes)
- {
- int i;
- char devname[160];
- int length;
-
-
- for (i = 0; i < numnodes; i++) {
- length = sizeof(devname);
- printf("Address %x devt %x node %s page size %d pm %d0,
- nbuf[i].vaddr,
- nbuf[i].node_dev,
- dev_to_devname(nbuf[i].node_dev, devname, &length),
- nbuf[i].page_size,
- nbuf[i].pm_handle);
- }
- }
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-
-
-
- ppppmmmmiiiinnnnffffoooo((((3333)))) ppppmmmmiiiinnnnffffoooo((((3333))))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 4444
-
-
-
-
-
-
-